<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>POS收单运营管理平台</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="<s:url value="/css/common.css"/>" type="text/css" rel="stylesheet" />	
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript">

	$(document).ready(
			function() {
			/* var flag = $("#flag").val();
			
			 if(flag=="01"){
			$("#remark").attr("readonly",false);
			} */
			var msg="${msg}";
			if(msg!=null)
			{
				refreshTab('C_07_M_03');//根据菜单索引刷新对应的tabpanel
			}
	});
	
	function deal(){
	$("#term").attr("disabled","true");
	  var flag = $("#flag").val();
	 // var remark = $("#remark").val();
	  /* if(flag=="01"&& remark==""){
	    alert("请填写冻结原因");
	    return false;
	  }else{
	    formSubmit();
	  } */	  
	  formSubmit();
	}
	
	function formSubmit(){
	    $("#queryUserForm").attr("action","<%=basePath%>/terminalSn/terminalClear.ct");
		$("#queryUserForm").submit();		
	}
	
	function refreshTab(index)
	{
		var parentWindow=window.parent.parent.document.getElementById("framemain").contentWindow;
		var posision=parentWindow.tabpanel.getTabPosision(index);
		if(!isNaN(posision))
		{
			parentWindow.frames[posision].document.getElementById("queryUserForm").submit();
		}
	}
	
	function backForm()
	{
		var parentWindow=window.parent.parent.document.getElementById("framemain").contentWindow;
		parentWindow.tabpanel.kill('freezeThaw');
	}
</script>

</head>

<body>
		<s:form id="queryUserForm"  method="post"
			theme="simple">
			<table class="tb">
   			 <tbody>
        		<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				<tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">
							终端操作
						</div>
					</td>
				</tr>
				<tr class="tb-line"><s:hidden name="mid" value="%{tblMchtInf.id}"/>
				
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">商户号：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.id"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">商户名称：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.nameBusi"/></td>
				    <td width="12%" style="min-width: 150px" align="right" class="tb-td">商户状态：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.status"/></td>
				</tr>
				<tr class="tb-line">
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">业务联系人：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.contactName"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">联系电话：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.contactPhoneNo"/></td>
				    <td width="12%" style="min-width: 150px" align="right" class="tb-td">终端状态：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><%-- <s:property value="termInfos.status"/> --%>
						<s:if test="termInfos.status=='01'">
							正常
						</s:if>
						<s:else>
							已冻结
						</s:else>
					</td>
				</tr>
				<tr class="tb-line"><s:hidden name="tid" value="%{termInfos.id.TermId}"/>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">终端号：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="termInfos.id.TermId"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">门店名称：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="tblMchtInf.name"/></td>
				    <td width="12%" style="min-width: 150px" align="right" class="tb-td">安装地址：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="termInfos.Installlocation"/></td>
				</tr>
				<tr class="tb-line"><s:hidden name="yjPos.serialNum" value="%{yjPos.serialNum}"/>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">终端序列号：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="yjPos.serialNum"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">终端主密钥索引：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="yjPos.tekId"/></td>
				    <td width="12%" style="min-width: 150px" align="right" class="tb-td">品牌：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="yjPos.posBrand"/></td>
				</tr>
				<tr class="tb-line">
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">机型：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="yjPos.posType"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">名称：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td"><s:property value="yjPos.posName"/></td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td" colspan="2"></td>
				</tr>
				<tr class="tb-line">
				    <td width="12%" style="min-width: 150px" align="right" class="tb-td">备注：</td>
					<td width="12%" style="min-width: 150px" align="left" class="tb-td" colspan="5">
<%-- 					<input type="text" maxlength="40"  class="someWidth"   name="remark" id="remark" value="<s:property value="termInfos.note"/>"/>
 --%>					<s:if test='termInfos.status == "01"'>
							<font color="red">*</font>
						</s:if>
					</td>
				</tr>
				<tr class="tb-line">
						<td colspan="6" align="center">
						<span style="font-color: red;"><s:actionerror /></span>
						<span style="font-color: red;"><s:actionmessage /></span > 
						<span style="font-color: red;"><s:fielderror cssClass="fieldError" /></span>
						<span style="font-color: red;" id="otherError"></span>
						</td>
					</tr>
				<tr class="tb-line">
					<td class="tb-td line-submit" align="center" colspan="6">
					<s:hidden name="termInfos.status" id="flag" value="%{termInfos.status}" />
					<label class="tb-input-submit">						
						<s:if test="deal == 3">
							<s:if test="termInfos.status == '01'">
								<s:submit id="term" value="冻结" onclick="deal()"/>
							</s:if>
							<s:else>
								<s:submit id="term" disabled="true" value="冻结" onclick="deal()"/>
							</s:else>
						</s:if>
						<s:else>
							<s:if test="termInfos.status == '00'">
								<s:submit id="term" value="解冻" onclick="deal()"/>
							</s:if>
							<s:else>
								<s:submit id="term" disabled="true" value="解冻" onclick="deal()"/>
							</s:else>
						</s:else>
						</label>
						<label class="tb-input-submit">
						<input type="button" value="返回" onclick="backForm()"/>
						</label>
					</td>
					
				</tr>
				</table>
			
		</s:form>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			$("#term").attr("disabled","true");
			$("#remark").attr("readonly","true");
		</script>
	</s:if>
</body>
</html>
